package it.polimi.TravelDream;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the packagejoin database table.
 * 
 */
@Entity
@NamedQueries({
@NamedQuery(name="Packagejoin.findAll", query="SELECT p FROM Packagejoin p"),
@NamedQuery(name="Packagejoin.findByPackID", query="SELECT p FROM Packagejoin p WHERE p.savedpackage.id LIKE :param1")
})
public class Packagejoin implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private PackagejoinPK id;

	private int joinedPeople;

	//bi-directional many-to-one association to Savedpackage
	@ManyToOne
	@JoinColumn(name="IDPackage")
	private Savedpackage savedpackage;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="IDJoiner")
	private User user;

	public Packagejoin() {
	}

	public PackagejoinPK getId() {
		return this.id;
	}

	public void setId(PackagejoinPK id) {
		this.id = id;
	}

	public int getJoinedPeople() {
		return this.joinedPeople;
	}

	public void setJoinedPeople(int joinedPeople) {
		this.joinedPeople = joinedPeople;
	}

	public Savedpackage getSavedpackage() {
		return this.savedpackage;
	}

	public void setSavedpackage(Savedpackage savedpackage) {
		this.savedpackage = savedpackage;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}